package com.common.base.app.extras

import android.app.Dialog
import android.view.View
import com.common.base.utils.ToastUtils

/**
 * 作者：sosou
 * <p>
 * 版本：1.0
 * <p>
 * 创建日期：2024/7/9
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
fun Dialog.getView(): View? {
    return this.window?.decorView
}

fun Dialog.setVisible(view: View?) {
    if (view?.visibility != View.VISIBLE) {
        view?.visibility = View.VISIBLE
    }
}

fun Dialog.setGone(view: View?) {
    if (view?.visibility != View.GONE) {
        view?.visibility = View.GONE
    }
}

fun Dialog.showToast(content: String?) {
    ToastUtils.showToast(content)
}

fun Dialog.showToast(resId: Int) {
    ToastUtils.showToast(resId)
}

fun Dialog.showCustomToast(content: String?) {
}

fun Dialog.showCustomToast(resId: Int) {
}

fun Dialog.showLongToast(content: String?) {
    ToastUtils.showLong(content)
}

fun Dialog.showLongToast(resId: Int) {
    ToastUtils.showLong(resId)
}
